package com.cm.api.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cm.api.entity.User;
import com.cm.api.mapper.UserMapper;
import com.cm.api.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @类 名：UserService </br>
 * @描 述：</br>
 * @日 期：2020/9/2 11:49</br>
 * @作 者：常明</br>
 * @版 本：1.0.0
 * @since JDK 1.8
 */
@Service
public class UserServiceImpl implements UserService{

    @Autowired
    UserMapper userMapper;
    @Override
    public boolean login(String username, String password) {
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.eq("username",username);
        queryWrapper.eq("password",password);
        List<User> users= userMapper.selectList(queryWrapper);
        if (users.size()>0){
            return true;
        }else
            return false;
    }
}
